<?php

/**
 * VehiculoUsuario form base class.
 *
 * @method VehiculoUsuario getObject() Returns the current form's model object
 *
 * @package    toyomotor
 * @subpackage form
 * @author     Ing. Roberto Hernández De La Luz at Netosfera
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseVehiculoUsuarioForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_vehiculo_usuario' => new sfWidgetFormInputHidden(),
      'id_ano_modelo'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('AnoModelo'), 'add_empty' => false)),
      'kilometraje'         => new sfWidgetFormInputText(),
      'placa'               => new sfWidgetFormInputText(),
      'id_usuario'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Usuario'), 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id_vehiculo_usuario' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_vehiculo_usuario')), 'empty_value' => $this->getObject()->get('id_vehiculo_usuario'), 'required' => false)),
      'id_ano_modelo'       => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('AnoModelo'))),
      'kilometraje'         => new sfValidatorInteger(),
      'placa'               => new sfValidatorString(array('max_length' => 10)),
      'id_usuario'          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Usuario'))),
    ));

    $this->widgetSchema->setNameFormat('vehiculo_usuario[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'VehiculoUsuario';
  }

}
